{
    "cells": [
        {
            "cell_type": "code",
            "execution_count": 34,
            "source": [
                "import pandas as pd\n",
                "dst_file = 'aa.xlsx'\n",
                "print('statistic', dst_file)\n",
                "data = pd.read_excel(dst_file, sheet_name=0, header=6)\n",
                "columns = [f'col_{x}' for x in range(0, 65)]\n",
                "data.columns = columns\n",
                "\n",
                "test_data = data.dropna(axis=0, subset=[\"col_2\"])\n",
                "\n",
                "fuxian = test_data[test_data[\"col_11\"] == '杞麓湖']\n",
                "su = fuxian[[\"col_4\", \"col_24\", \"col_34\"]].sum(axis=0)\n",
                "\n",
                "\n",
                "# print(test_data.groupby(test_data.dtypes, axis=1).groups)\n"
            ],
            "outputs": [
                {
                    "output_type": "stream",
                    "name": "stdout",
                    "text": [
                        "statistic aa.xlsx\n"
                    ]
                }
            ],
            "metadata": {}
        },
        {
            "cell_type": "code",
            "execution_count": 35,
            "source": [
                "tuijian = test_data.groupby(['col_11', 'col_1'])[['col_4', \"col_24\", \"col_34\"]].sum()\n",
                "tuijian2 = test_data.groupby(['col_11'])[['col_4', \"col_24\", \"col_34\"]].sum()\n",
                "\n",
                "\n",
                "print(tuijian)\n",
                "print(tuijian2)"
            ],
            "outputs": [
                {
                    "output_type": "stream",
                    "name": "stdout",
                    "text": [
                        "                   col_4     col_24  col_34\n",
                        "col_11 col_1                               \n",
                        "抚仙湖    1-退的措施   63800.00   63800.00       0\n",
                        "       2-减的措施   55897.31   55897.31       0\n",
                        "       3-调的措施   41000.00   41000.00       0\n",
                        "       4-治的措施   99056.89   99056.89       0\n",
                        "       5-管的措施   51725.00   51725.00       0\n",
                        "星云湖    1-退的措施   40725.37   40725.37       0\n",
                        "       2-减的措施   33170.78   33170.78       0\n",
                        "       3-调的措施   56000.00   56000.00       0\n",
                        "       4-治的措施  221802.94  221802.94       0\n",
                        "       5-管的措施   11150.00   11150.00       0\n",
                        "杞麓湖    1-退的措施    3000.00       0.00       0\n",
                        "       2-减的措施   31519.00       0.00       0\n",
                        "       3-调的措施  140575.00       0.00       0\n",
                        "       4-治的措施  397519.00       0.00       0\n",
                        "       5-管的措施    3400.00       0.00       0\n",
                        "            col_4     col_24  col_34\n",
                        "col_11                              \n",
                        "抚仙湖     311479.20  311479.20       0\n",
                        "星云湖     362849.09  362849.09       0\n",
                        "杞麓湖     576013.00       0.00       0\n"
                    ]
                }
            ],
            "metadata": {}
        },
        {
            "cell_type": "code",
            "execution_count": 44,
            "source": [
                "kaigong = test_data[~(test_data['col_17'].isna())]['col_2'].count()\n",
                "# kaigong2 = test_data[test_data['col_17'].isna()].count()\n",
                "\n",
                "print(kaigong)"
            ],
            "outputs": [
                {
                    "output_type": "stream",
                    "name": "stdout",
                    "text": [
                        "col_0     1\n",
                        "col_1     1\n",
                        "col_2     1\n",
                        "col_3     1\n",
                        "col_4     1\n",
                        "         ..\n",
                        "col_60    0\n",
                        "col_61    0\n",
                        "col_62    0\n",
                        "col_63    0\n",
                        "col_64    1\n",
                        "Length: 65, dtype: int64\n"
                    ]
                }
            ],
            "metadata": {}
        }
    ],
    "metadata": {
        "orig_nbformat": 4,
        "language_info": {
            "name": "python",
            "version": "3.7.5",
            "mimetype": "text/x-python",
            "codemirror_mode": {
                "name": "ipython",
                "version": 3
            },
            "pygments_lexer": "ipython3",
            "nbconvert_exporter": "python",
            "file_extension": ".py"
        },
        "kernelspec": {
            "name": "python3",
            "display_name": "Python 3.7.5 64-bit"
        },
        "interpreter": {
            "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
        }
    },
    "nbformat": 4,
    "nbformat_minor": 2
}